@echo off
set _max=0
for %%f IN (%~dp0*) DO (call :doit %%f)
echo 1.%_max% > "%~dp0\version.txt"
goto :eof
:doit
if "%~t1" == "" goto :eof
set _t=%~t1
if "%_T:~2,1%"=="-" set _t=%_t:~6,4%%_t:~3,2%%_t:~0,2%
if "%_T:~4,1%"=="-" set _t=%_t:~0,4%%_t:~5,2%%_t:~8,2%
if %_t% GTR %_max% set _max=%_t%
goto :eof
